﻿

namespace Sai.Core.Reporting
{
    using System;

    public class TypeFormatPair
    {
        public TypeFormatPair()
        {
        }

        public TypeFormatPair(Type t, ReportFormat r)
        {
            this.TypeName = t.Name;
            this.Format = r;
        }

        public string TypeName { get; set; }

        public ReportFormat Format { get; set; }

        public override string ToString()
        {
            return this.TypeName + this.Format.ToString();
        }

        public override int GetHashCode()
        {
            return this.ToString().GetHashCode();
        }

        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return false;
            }

            TypeFormatPair pair = obj as TypeFormatPair;

            if ((object)pair == null)
            {
                return false;
            }

            return this.TypeName == pair.TypeName && this.Format == pair.Format;
        }
    }
}
